<template>
    <div @click="switchVoice" class="message-con">
        <Tooltip :content="value ? '点击关闭语音提醒' : '点击打开语音提醒'" placement="bottom">    
                <Icon v-if="value" type="android-volume-up" :size="22"></Icon>
                <Icon v-else type="android-volume-off" :size="22"></Icon>
        </Tooltip>
    </div>
</template>

<script>
import util from '@/libs/util.js';
export default {
    name: 'messageTip',
    props: {
        value: {
            type: Number,
            default: 0
        }
    },
    methods: {
        // showMessage () {
        //     util.openNewPage(this, 'message_index');
        //     this.$router.push({
        //         name: 'message_index'
        //     });
        // },
        switchVoice () {
            let i
            if(this.value==1){
                i=0
            }else{
                i=1
            }
            this.$store.commit('setMessageCount', i);
            util.setUpVoiceReminders(this)
        }
    }
};
</script>
